package com.qhit.pojo;

import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class Tourist {
    private String id;
    private String touristName;
    private String touristSex;
    private String touristIdcard;
    private String touristPhone;
    @JsonFormat(pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern="yyyy-MM-dd")
    private Date touristBrithday;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getTouristName() {
        return touristName;
    }

    public void setTouristName(String touristName) {
        this.touristName = touristName;
    }

    public String getTouristSex() {
        return touristSex;
    }

    public void setTouristSex(String touristSex) {
        this.touristSex = touristSex;
    }

    public String getTouristIdcard() {
        return touristIdcard;
    }

    public void setTouristIdcard(String touristIdcard) {
        this.touristIdcard = touristIdcard;
    }

    public String getTouristPhone() {
        return touristPhone;
    }

    public void setTouristPhone(String touristPhone) {
        this.touristPhone = touristPhone;
    }

    public Date getTouristBrithday() {
        return touristBrithday;
    }

    public void setTouristBrithday(Date touristBrithday) {
        this.touristBrithday = touristBrithday;
    }

    @Override
    public String toString() {
        return "Tourist{" +
                "id='" + id + '\'' +
                ", touristName='" + touristName + '\'' +
                ", touristSex='" + touristSex + '\'' +
                ", touristIdcard='" + touristIdcard + '\'' +
                ", touristPhone='" + touristPhone + '\'' +
                ", touristBrithday=" + touristBrithday +
                '}';
    }
//    public void setTouristBrithday1(String touristBrithday) throws ParseException {
//        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
//        this.touristBrithday=simpleDateFormat.parse(touristBrithday);
//    }
//    public String getTouristBrithday1() {
//        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
//        return simpleDateFormat.format(this.touristBrithday);
//    }
}
